package com.springmvc.handler;

import com.springmvc.bean.User;
import com.springmvc.service.Userservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserHandler {
    @Autowired
    private Userservice userservice;
    @GetMapping("/user/{id}")
    public User getUser(@PathVariable("id") Long id){
        return userservice.getUserById(id);
    }
}
